package com.apkcore.flowlib.example

import android.util.Log
import com.apkcore.flowlib.flow.*

/**
 * @author chanehao
 * @date 2023/03/08
 * @apiNote
 */
class OneState : Interceptor<Int> {
    companion object {
        private const val TAG = "OneState"
    }

    override suspend fun intercept(chain: Chain, request: Request): Request {
        // 在这里可以实现拦截器逻辑
        request.values["abc"] = "get"
        val modifiedRequest = request.copy(resultSuccess = true)
        Log.d(TAG, "Interceptor 1 executed, request: $modifiedRequest")
        return chain.proceed(modifiedRequest)
    }

    override fun feedback(): Int {
        return 1111111
    }
}